<?php $website_url = Configure::read('Website.url'); ?>
<!--<script>
$(document).ready(function(){
        $('#Allshipping_2').click(function(){
                                 alert('hi');
                                 return false;
         });
});
</script>
--><div class="cat_page">
    <div class=" def_div f_left">
        <?php
        if (isset($product_detail) and ($product_detail)) {
            ?>
            <div class="seller_info_view">
                <div class=" width_15 f_left"> <?php echo $html->link($html->image('Product/' . $product_detail['Product']['img'], array('width' => '120', 'height' => '120')), array('controller' => 'products', 'action' => 'product', $product_detail['Product']['slug']), array('escape' => false)); ?> </div>
                <div class="width_84 f_left">
                    <h2><?php echo $html->link($product_detail['Product']['name'], array('controller' => 'products', 'action' => 'product', $product_detail['Product']['slug']), array('escape' => false, 'class' => '')); ?> </h2>
                    <div class="def_div f_left"><span>
                            <?php
                            echo $html->link($product_detail['Product']['Brand']['name'], array('controller' => 'products', 'action' => 'index', "category_slug" => "", "index" => "", "brand_slug" => $product_detail['Product']['Brand']['slug']), array('class' => 'blue_link'));
                            ?>
                        </span></div>
                    <div class="def_div f_left"><span>Always pay through Wondere.com's Shopping Cart.
                            Your purchase will be protected by the<a href="javascript:void(0);" class="brown_link"> A-to-z Safe Buying Guarantee</a>. Never respond to requests to send funds via wire transfer. Learn more about <a href="javascript:void(0);" class="brown_link">Safe Online Shopping</a>. </span></div>
                    <div class="common_border1"></div>
                    <div class="item_list_B">
                        <ul>
                            <li>
                                <h4>Price at a Glance</h4>
                            </li>
                            <li>
                                <p><span>list Price : </span><span class="over_line">$<?php echo $product_detail['Product']['msrp']; ?></span></p>
                            </li>
    <?php
    if (isset($price_list) and ($price_list)) {
        foreach ($price_list as $price) {
            ?>
                                    <li>
                                        <p> <span><?php echo $price['name']; ?> Price :</span> <span class="red">$<?php echo $price[$price['name']]; ?></span> </p>
                                    </li>
                                    <?php
                                }
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
    <?php
}
?>
        <div class="pad_10"></div>
        <div class="def_div f_left" id="add_prod">
        <?php
        if (isset($offer_list) and ($offer_list)) {
            ?>
                <ul>
                    <li><a href="#fragment-13"><span>All</span></a></li>
                <?php
                foreach ($offer_list as $offer) {
                    ?>
                        <li><a href="#fragment-<?php echo $offer['name']; ?>"><span><?php echo $offer['name']; ?></span></a></li>
                        <?php
                    }
                    ?>
                </ul>
                    <?php
                }
                ?>
                <?php
                if (isset($offer_list) and ($offer_list)) {
                    //pr($offer_list);
                    //exit;
                    ?>
                <div id="fragment-13">
                    <div class="paging_gray">
                        <p>Show &nbsp;&nbsp;
                            <label >
                                <input id="Allshipping_1" name="Allshipping" type="radio" onclick="$('.MyPriceShpping').hide();"  />
                                FREE Super Saver Shipping offers only </label>
                            &nbsp;&nbsp;
                            <label >
                                <input id="Allshipping_2" name="Allshipping" onclick="$('.MyPriceShpping').show();"  checked="checked" type="radio" />
                                All</label>
                        </p>
                        <!--<span class="f_right">
                        <select>
                          <option>1</option>
                        </select>
                        <label> Sort By</label>
                        </span>--> </div>
                    <h2>Featured Merchants </h2>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table_list_3">
    <?php if (isset($offer_list) and ($offer_list))
         ?>
                        <tr class="tGb_blk">
                            <th width="25%">Price + Shipping</th>
                            <th width="12%">Condition</th>
                            <th width="48%">Seller Information</th>
                            <th width="11%">Buying Options</th>
                        </tr>
    <?php
    foreach ($offer_list as $offerN) {


        $offer_name_list_n = $offerN[$offerN['name']];
        $cv1 = 0;
        foreach ($offer_name_list_n as $offe_n) {
            if (($cv1 % 2) == 0) {
                $class = "";
            } else {
                $class = "#f3f3f3";
            }
            if (isset($offe_n['MasterProduct']['shipping_price']) and $offe_n['MasterProduct']['shipping_price']) {
                $shipping_class = "MyPriceShpping";
            } else {
                $shipping_class = "";
            }
            ?>

                                <tr bgcolor="<?php echo $class; ?>" class="<?php echo $shipping_class; ?>">
                                    <td width="25%">
                                        <span class="font_16 red">
                                            <b>$<?php echo $offe_n['MasterProduct']['price']; ?></b></span> &amp; this item ships for<br />
                                        <span class="gray_comment">
                                            <b>
                                <?php
                                if (isset($offe_n['MasterProduct']['shipping_price']) and $offe_n['MasterProduct']['shipping_price']) {
                                    echo "$" . $offe_n['MasterProduct']['shipping_price'] . ' Shipping';
                                } else {
                                    ?>
                                                    FREE Shipping
                                <?php } ?>
                                            </b>
                                            .</span></td>
                                    <td width="12%"><span class="font_16"><b><?php echo $offe_n['MasterProduct']['cond']; ?></b></span></td>
                                    <td width="48%">
            <?php
            $date = mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"));
            ?>

                                        In Stock. Want it delivered <?php echo date("D M d", $date); ?>? 
                                        Order it in the next <?php echo date("h") + 12; ?> hours and 38 minutes, and choose soon.</td>
                                    <td width="11%">
                                                <?php
                                                //pr($offe_n);
                                                //exit;
                                                $selle_token = __get_seller_token($offe_n['MasterProduct']['seller_id']);
                                                //echo  $selle_token;
                                                echo $html->link("Add to cart", array('controller' => 'products', 'action' => 'cart', "add",
                                                    $product_detail['Product']['slug'], $selle_token), array('class' => "small_add2cart"));
                                                ?>
                                    </td>
                                </tr>
                                        <?php
                                        $cv1++;
                                    }
                                }
                                ?>


                    </table>
                </div>
                                <?php
                                foreach ($offer_list as $offer) {
                                    ?>
                    <div id="fragment-<?php echo $offer['name']; ?>">
                        <div class="paging_gray">
                            <p>Show &nbsp;&nbsp;
                                <label >
                                    <input  id="NewShipping_1" name="NewShipping" type="radio" onclick="$('.NewMyPriceShpping').hide();" />
                                    FREE Super Saver Shipping offers only 
                                </label>
                                &nbsp;&nbsp;
                                <label >
                                    <input id="NewShipping_2" name="NewShipping"  onclick="$('.NewMyPriceShpping').show();"  checked="checked" type="radio" />
                            <?php echo strtoupper($offer['name']); ?></label>
                            </p>
                           <!-- <span class="f_right">
                            <select>
                              <option>1</option>
                            </select>
                            <label> Sort By</label>
                            </span>--> </div>
                        <h2>  <?php echo strtoupper($offer['name']); ?></h2>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table_list_3">
                            <tr class="tGb_blk">
                                <th width="25%">Price + Shipping</th>
                                <th width="12%">Condition</th>
                                <th width="48%">Seller Information</th>
                                <th width="11%">Buying Options</th>
                            </tr>
        <?php
        $offer_name_list = $offer[$offer['name']];

        if (isset($offer_name_list) and ($offer_name_list))
            $cv = 0;

        foreach ($offer_name_list as $offerN) {

            if (($cv % 2) == 0) {
                $class = "";
            } else {
                $class = "#f3f3f3";
            }

            if (isset($offerN['MasterProduct']['shipping_price']) and $offerN['MasterProduct']['shipping_price']) {
                $new_shipping_class = "NewMyPriceShpping";
            } else {
                $new_shipping_class = "";
            }
            ?>
                                <tr bgcolor="<?php echo $class; ?>" class="<?php echo $new_shipping_class; ?>">
                                    <td width="25%"><span class="font_16 red"><b>$<?php echo $offerN['MasterProduct']['price']; ?></b></span> &amp; this item ships for<br />
                                        <span class="gray_comment"><b>
                                <?php
                                if (isset($offerN['MasterProduct']['shipping_price']) and $offerN['MasterProduct']['shipping_price']) {
                                    echo "$" . $offerN['MasterProduct']['shipping_price'] . ' Shipping';
                                } else {
                                    ?>
                                                    FREE Shipping
                                <?php } ?>
                                            </b>.</span></td>
                                    <td width="12%"><span class="font_16"><b><?php echo $offerN['MasterProduct']['cond']; ?></b></span></td>
                                    <td width="48%">
                                <?php
                                $date = mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"));
                                ?>

                                        In Stock. Want it delivered <?php echo date("D M d", $date); ?>? Order it in the next <?php echo date("h") + 12; ?> hours and 38 minutes, and choose soon.</td>
                                    <td width="11%">	
                                <?php
                                //echo  $selle_token;
                                $selle_token = __get_seller_token($offerN['MasterProduct']['seller_id']);
                                echo $html->link("Add to cart", array('controller' => 'products', 'action' => 'cart', "add",
                                    $product_detail['Product']['slug'], $selle_token), array('class' => "small_add2cart"));
                                ?>
                                    </td>
                                </tr>
                                                <?php $cv++;
                                            } ?>
                        </table>
                    </div>
                                            <?php
                                        }
                                    }
                                    ?>
        </div>
    </div>
</div>
